package io.wins.vertx.utils;

import io.vertx.core.json.JsonObject;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

/**
 * @author wins
 */
public final class JsonUtils {

    public static JsonObject readFromFile(final File file) throws FileNotFoundException {
        try (Scanner scanner = new Scanner(file)) {
            final Scanner s = scanner.useDelimiter("\\A");
            final String sconf = s.next();
            return new JsonObject(sconf);
        }
    }
}
